package org.example;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;


public class OneClassInLoader {

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
        MyClassLoader myClassLoader = new MyClassLoader();
        Class bClass = myClassLoader.defineClass("org.Test", Generator.getBytecodeForClass());

        Constructor constructor = bClass.getConstructor();
        Object o = constructor.newInstance();
        Example e = (Example) o;
        e.run("test");
    }
}
